package cn.kgc.bilibili.service.impl;

import cn.kgc.bilibili.dao.FavMapper;
import cn.kgc.bilibili.pojo.Favrelation;
import cn.kgc.bilibili.pojo.Userfav;
import cn.kgc.bilibili.pojo.Video;
import cn.kgc.bilibili.service.FavService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("favService")
public class FavServiceImpl implements FavService {
    @Resource
    private FavMapper favMapper;


    @Override
    public List<Userfav> getUserFavByid(int userid) {
        return favMapper.getUserFavByid(userid);
    }

    @Override
    public List<Video> getFavofVideoByid(int userfavid) {
        return favMapper.getFavofVideoByid(userfavid);
    }

    @Override
    public int insertFav(Userfav userfav) {

        return favMapper.insertFav(userfav);
    }

    @Override
    public int insert(Favrelation favrelation) {
        return favMapper.insert(favrelation) ;
    }

    @Override
    public int updateFav(Userfav userfav) {
        return favMapper.updateFav(userfav);
    }

    @Override
    public int deleteFav(int id) {
        return favMapper.deleteFav(id);
    }
}
